package com.simen.downloader.sample;

import android.app.Application;
import android.content.Context;
import android.support.multidex.MultiDex;
import android.support.multidex.MultiDexApplication;

import com.simen.downloader.DownloadConfiguration;
import com.simen.downloader.Downloader;
import com.squareup.leakcanary.LeakCanary;

/**
 * Created by zhangming on 16/5/11.
 */
public class MyAPP extends MultiDexApplication {
    private static Context context = null;

    public static Context getContext() {
        return MyAPP.context;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        MultiDex.install(this);
        LeakCanary.install(this);
        context = getApplicationContext();
        DownloadConfiguration configuration = new DownloadConfiguration.Builder(this)
                .setThreadPoolSize(3).requirelist(true).build();
        Downloader.getInstance().init(configuration);
    }
}
